home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 028a / pxdos21a.zip / POLYXARC.DOC < prev    next >
Text File  |  1991-05-12  |  42KB  |  917 lines

  1.  
  2.                                                                 page 1
  3.  
  4.  
  5.                                     PolyXarc
  6.                                v2.1a  12 May 1991
  7.                        Public domain by Jeffrey J. Nonken
  8.                             OS/2 port by Bill Andrus
  9.  
  10.         By  giving this away, complete with source code and docs, I  hope 
  11.         to  encourage others to do likewise. I think we can all  gain  in 
  12.         the long run by sharing. Public Domain means that nobody owns it. 
  13.         You  can  give  it away, sell it,  incorporate  bits  into  other 
  14.         programs, whatever you want. However, in the interests of program 
  15.         management,  I request that if you make changes that may  benefit 
  16.         others, you
  17.          1) Share them with us;
  18.          2) Send me a copy of source so I can make an 'official' release.
  19.  
  20.         Warranty: none.
  21.  
  22.         Address  netmail to 1:273/715 in Fidonet. If you wish to log  on, 
  23.         call (215)279-9799 (300/1200/2400/9600/14400 HST/V.32),  PCPable. 
  24.         You  can get the latest distribution version of PolyXarc by  file 
  25.         requesting POLYXARC from 1:273/715. If you wish to send  anything 
  26.         via U.S. Snail, write to:
  27.  
  28.                                Jeffrey J. Nonken
  29.                                1706 Cherrie Circle
  30.                                Blue Bell, Pa. 19422-3412
  31.  
  32.         See the end of this document for address change information. 
  33.  
  34.         NOTE:  Version  2.0 has major changes in the  configuration  file 
  35.         syntax. VERSION 1.x CONFIGURATION FILES WILL NOT WORK WITH 2.x! I 
  36.         have  made  no  attempts to detect old  configuration  files  and 
  37.         provide correction or warning; that would complicate and  enlarge 
  38.         PolyXarc  unnecessarily.  It  is  up to you  to  make  sure  your 
  39.         configuration  files have been replaced or updated.  Version  2.0 
  40.         configuration files will work just peachy with version 2.1.
  41.  
  42.         WHAT IT IS
  43.         ==========
  44.         "Poly"  means  "many",  and  "Xarc"  means  "archive  extractor". 
  45.         PolyXarc  is a program that permits automatic extraction of  most 
  46.         known  archive formats. By "Xarc" I do not specifically refer  to 
  47.         SEA's  ARC or XARC programs or the file format supported  by  ARC 
  48.         (which  I  will  refer  to as  ".ARC  format"  herein),  although 
  49.         PolyXarc  supports both. The purpose of this program is to  allow 
  50.         Fidonet  BBS  system operators to automatically  extract  bundles 
  51.         that have been made with various archive programs.  Traditionally 
  52.         sysops  have used one .ARC format program or another. But  recent 
  53.         improvements  in  compression techniques, along  with  a  rapidly 
  54.         climbing  volume of echomail, have encouraged sysops to  look  at 
  55.         other programs.
  56.  
  57.         It  is  not  my purpose to praise or encourage  the  use  of  one 
  58.         archive  format  over  another. In fact,  the  whole  purpose  of 
  59.         PolyXarc is to support as wide a variety as possible. 
  60.  
  61.  
  62.            PolyXarc 2.1a: multiple-format archive extractor executive
  63.                                                                 page 2
  64.  
  65.  
  66.  
  67.         PolyXarc   does  not  itself  extract  archive  files;   PolyXarc 
  68.         identifies   which  format  is  being  used  and  calls  on   the 
  69.         appropriate  archive extractor program to do the actual work.  In 
  70.         this  lies  its  flexibility. Think of PolyXarc  as  an  "Archive 
  71.         Extractor Executive".
  72.  
  73.         PolyXarc is a direct replacement for SPAZ v1.40 (developed by Dan 
  74.         Thomson  and Andrew Farmer), except that PolyXarc is much  larger 
  75.         (about 35k vs. 6k) and may not work in cases where memory is at a 
  76.         premium.  However,  PolyXarc  is more  versatile  and  much  more 
  77.         flexible.
  78.  
  79.         PolyXarc's main features are:
  80.          - Automatic stand-alone mail bundle extraction;
  81.          - Small and fast;
  82.          - Flexible and adaptable.
  83.  
  84.         PolyXarc  can find all mail bundles in a specified directory  and 
  85.         de-archive  all of them. In addition, PolyXarc can  sort  version 
  86.         5 .ARC files by their date/timestamps before beginning extraction 
  87.         to assure that the packets are, as much as possible, extracted in 
  88.         the correct order. PolyXarc also gives you the choice of limiting 
  89.         the number of archives that it extracts in a session so that  you 
  90.         can process them a few at a time instead of all at once.
  91.  
  92.         I  tried to write PolyXarc to be as flexible and expandable as  I 
  93.         could  within reason. Unlike most multi-archive mail  unbundlers, 
  94.         except  for some .ARC format recognition, PolyXarc does not  have 
  95.         any specific format recognition built in. Instead, PolyXarc has a 
  96.         configuration  file that contains signature strings  and  command 
  97.         line  templates, allowing you to expand  PolyXarc's  capabilities 
  98.         without having to write any code. In addition, you can  customize 
  99.         PolyXarc's recognition of .ARC format compression flags, and tell 
  100.         it  which  program to use for which flag. However,  if  all  else 
  101.         fails,  and you come upon a format for which PolyXarc  cannot  be 
  102.         configured, you can alter the source to accomodate it, for I have 
  103.         released  the  source  code  to the  public  domain.  This  gives 
  104.         unlimited  permission  for  anybody  to  alter  it,  providing  a 
  105.         permanent upgrade path.
  106.  
  107.         If  the  explanations in this document don't make sense,  take  a 
  108.         look at POLYXPLN.DOC; it picks apart the config file and explains 
  109.         some details about the archivers.
  110.  
  111.         HOW TO USE IT
  112.         =============
  113.         PolyXarc's syntax is:
  114.  
  115.           PolyXarc [switches] archive [name [name...]] [switches]
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.            PolyXarc 2.1a: multiple-format archive extractor executive
  124.                                                                 page 3
  125.  
  126.  
  127.         Recognized switches are:
  128.           -Cconfig               -I                     -O                     
  129.           -D                     -Maddr                 -R                     
  130.           -F[n]                  -N                     -Q                     
  131.           -#
  132.  
  133.         archive
  134.  
  135.         This is the name of the archive file you wish to extract from, or 
  136.         if  you  specify the -F switch, the path where mail  bundles  are 
  137.         kept. In the former case (not using -F) wildcards are  supported, 
  138.         and  if you do not supply an extension, PolyXarc will  assume  an 
  139.         extension  of  ".*".  In the latter case  (using  -F),  you  must 
  140.         specify a path ONLY, not a file name. Also, if you specify -F you 
  141.         may leave the archive path out completely and it will default  to 
  142.         the current directory.
  143.  
  144.         name...
  145.  
  146.         This  is  one or more names of files within the archive.  If  you 
  147.         list  more  than one name, they should be  separated  by  spaces. 
  148.         These are optional. If left off, most extractors will assume that 
  149.         you  want  to extract all files. You must list the  archive  name 
  150.         (above) before listing individual file names. PolyXarc  considers 
  151.         any parameter that does not start with a switch character ('-' or 
  152.         '/') to be a file name or archive name.
  153.  
  154.         -Cconfig
  155.  
  156.         This  is  the  file  that  contains  signature  information   for 
  157.         PolyXarc.  If  it is not in your current  subdirectory  you  must 
  158.         supply a path to it as well. The file name must follow the switch 
  159.         with  no  intervening  spaces. If you do not specify  -C  on  the 
  160.         command  line, PolyXarc will look first for POLYXARC.CFG  in  the 
  161.         current directory, then in the directory of the .EXE file, and if 
  162.         not found will then look for a PENGUIN file (described later).
  163.  
  164.         -D
  165.  
  166.         Specifying this will cause PolyXarc to delete any archive file it 
  167.         successfully has extracted. Specifying the /F parameter causes /D 
  168.         to be enabled unconditionally.
  169.  
  170.         -F[n]
  171.  
  172.         -F  will  cause PolyXarc to extract all the mail bundles  it  can 
  173.         find in the subdirectory specified by 'archive'. If you specify a 
  174.         number after the F (like "-F2"), PolyXarc will extract up to that 
  175.         number of mail bundles. In this case 'archive' (above) must be  a 
  176.         path,  not a filename. Specifying -F also forces -D and  -O,  and 
  177.         disables -N.
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.            PolyXarc 2.1a: multiple-format archive extractor executive
  185.                                                                 page 4
  186.  
  187.  
  188.         -I
  189.  
  190.         I really mostly intended this for use in some manual modes.  This 
  191.         switch  will  cause PolyXarc to ignore errors returned  from  the 
  192.         archivers.
  193.  
  194.         -Maddr
  195.  
  196.         This causes PolyXarc to calculate and display the net address  of 
  197.         the  sender of each bundle. 'addr' is your netmail  address,  net 
  198.         and node only. Example: -M273/715.
  199.  
  200.         -N
  201.  
  202.         Specifying  this causes PolyXarc not to attempt to  sort  an .ARC 
  203.         format file. Normal action is to sort all .ARC format files  (the 
  204.         files inside the archive) by the date and time stamps. Specifying 
  205.         -F  will override -N and cause PolyXarc to sort the  files.  Note 
  206.         that PolyXarc will not sort ARC version 6 files.
  207.  
  208.         -O
  209.  
  210.         This is the overwrite flag. If the archiver finds that a file  it 
  211.         is  extracting  already  exists,  this  flag  will  cause  it  to 
  212.         overwrite  the  old  file without prompting.  Specifying  the  -F 
  213.         parameter causes -O to be enabled unconditionally.
  214.  
  215.         -R
  216.  
  217.         This  is  the same as -O. I included it to maintain  ARCE  syntax 
  218.         compatibility  for people who want to call PolyXarc  from  within 
  219.         other programs (such as Opus 1.0).
  220.  
  221.         -Q
  222.  
  223.         Specifying  -Q  causes PolyXarc not to display  most  status  and 
  224.         configuration messages. Error messages will still be displayed.
  225.  
  226.         -#
  227.  
  228.         Normally  when you invoke the -F switch, PolyXarc  will  unbundle 
  229.         files  with  extensions starting with .MO, .TU, etc.  and  ending 
  230.         with any character. If you add the -# switch, PolyXarc will  only 
  231.         unbundle files ending with a decimal digit (0-9).
  232.  
  233.              NOTE:  None of these switches is position dependent  or 
  234.              case sensitive. Any may be specified with a hyphen  (-) 
  235.              or  a slash (/). If you specify a question mark (?)  as 
  236.              the first parameter, you will get a brief help  message 
  237.              and no processing will be done.
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.            PolyXarc 2.1a: multiple-format archive extractor executive
  246.                                                                 page 5
  247.  
  248.  
  249.         PolyXarc  requires a single configuration file. This  file  gives 
  250.         PolyXarc enough information to recognize various archive  formats 
  251.         by  looking  for specific 'signatures'. There are three  ways  to 
  252.         specify the configuration file name:
  253.          - just  have  POLYXARC.CFG in the current directory, or  in  the 
  254.            directory with POLYXARC.EXE;
  255.          - use the -C switch to specify it on the command line;
  256.          - use a PENGUIN file.
  257.  
  258.         Doug  Boone  has  proposed  an idea  that  I  like;  rather  than 
  259.         proliferate configuration files, gather as many as possible  into 
  260.         one file. His implementation requires you to specify the file  in 
  261.         an  environment  variable called PENGUIN. PolyXarc  may  use  the 
  262.         PENGUIN technique if you have set the environment variable.
  263.  
  264.         This  is  how  PolyXarc decides which technique to  use:  if  you 
  265.         specify  a  file  on the command line  using  the  -C  parameter, 
  266.         PolyXarc  will  use  that  file. If  you  don't  specify  the  -C 
  267.         parameter,  PolyXarc  will look for POLYXARC.CFG in  the  current 
  268.         directory.  If it doesn't exist, PolyXarc will then look  in  the 
  269.         directory  that it was executed from. If it isn't  there  either, 
  270.         PolyXarc  will look for the PENGUIN environment variable.  If  it 
  271.         exists, PolyXarc will use that file; otherwise, it will exit with 
  272.         an error. 
  273.  
  274.         To  set the environment variable, you would put a statement  like 
  275.         this into your AUTOEXEC.BAT file:
  276.  
  277.           SET PENGUIN=D:\OPUS\PENGUIN.CFG
  278.  
  279.         There  are three  keywords  that  PolyXarc  recognizes  in   the 
  280.         configuration file, one of which has three variations, plus BEGIN 
  281.         and  END  statements. PolyXarc will not  recognize  any  keywords 
  282.         until  it  sees  a  BEGIN POLYXARC  statement,  and  will  ignore 
  283.         anything  after an END POLYXARC statement until it  sees  another 
  284.         BEGIN  POLYXARC, if any. You may have as many of these blocks  as 
  285.         you  want in the configuration file, and they may  overlap  other 
  286.         programs'  blocks if you wish. PolyXarc will ignore  anything  it 
  287.         doesn't recognize. The keywords are:
  288.  
  289.           ARC
  290.           ARC5 (same as ARC)
  291.           ARC6
  292.           SIGNATURE
  293.           NOSORT
  294.  
  295.         Before  I  describe  the keyword syntaxes,  let  me  explain  the 
  296.         command  templates they use. A command template is a  description 
  297.         of  the command line used to call a certain program. The  general 
  298.         syntax of a command line consists of the command, followed by one 
  299.         or more parameters, the overwrite flag key, the extract flag key, 
  300.         the filename key, and/or the extractname key. The parameters  and 
  301.         keys  may be in different orders depending on the syntax  of  the 
  302.         particular archive extractor you are using.
  303.  
  304.  
  305.  
  306.            PolyXarc 2.1a: multiple-format archive extractor executive
  307.                                                                 page 6
  308.  
  309.  
  310.         The  command  is the actual DOS command used to run  the  program 
  311.         (such  as  "ZOO" or "ARCE"). The parameters  are  any  parameters 
  312.         needed  to cause an extraction. The extract flag key is  actually 
  313.         an  'insert  flag' that tells PolyXarc where to put  the  extract 
  314.         switch  if  it  is  needed. The extract flag  key  is  "%1".  The 
  315.         overwrite  flag  key,  "%2",  tells PolyXarc  where  to  put  the 
  316.         overwrite switch if it is needed. The filename key, "%3", is  the 
  317.         name of the archive to extract from, and is also an insert  flag. 
  318.         The extractname key, "%4", is a list of names of files to extract 
  319.         from  the archive. Another way of looking at it is that you  take 
  320.         the general syntax for the particular archiver, put a %1 in place 
  321.         of the extract switch (if any... most archivers will not actually 
  322.         use this field), a %2  in place of the overwrite switch, a %3  in 
  323.         place  of the archive filename, and a %4 where the list of  files 
  324.         would  be  if you wanted to specify which files to  extract.  The 
  325.         actual order of these parameters depends on what each  particular 
  326.         archiver expects to see.
  327.  
  328.         As  mentioned  above, most extractors will not need  the  extract 
  329.         flag  key. In most cases, the extractors have an extract  command 
  330.         (either  explicit  or  implied) that is  used  whether  you  want 
  331.         automatic  overwrite or not; to overwrite, you use the  overwrite 
  332.         command  in addition to the extract command. I have not seen  any 
  333.         archive  extractor  that  uses a separate  command  for  extract-
  334.         without-overwrite versus extract-with-overwrite; nevertheless,  I 
  335.         would  rather include support for a redundant parameter now  than 
  336.         have  to 'fix' it later. In any case, the extract flag  key  will 
  337.         only  be  used if overwrite option is not invoked  on  PolyXarc's 
  338.         command line, and the overwrite flag key will only be used if the 
  339.         overwrite option is invoked. If there is an extract command  that 
  340.         is  used  whether or not overwrite is invoked,  then  you  should 
  341.         include it as a permanent part of the template for that command.
  342.  
  343.         General syntax for the ARC keywords:
  344.  
  345.           ARC level overwrite extract command_template
  346.           ARC5 level overwrite extract command_template
  347.           ARC6 level overwrite extract command_template
  348.  
  349.         PolyXarc recognizes .ARC format files internally. The ARC command 
  350.         spec  defines  a  level (known as a  'header  type'  by  the .ARC 
  351.         compatible  programs)  at  which  a  certain  program  should  be 
  352.         executed.  ARC  programs  will generally  extract  any  level  of 
  353.         compression up to the level they are capable of. For example, ARC 
  354.         version  5  and ARCE will extract up to level 8; ARC  version  6, 
  355.         PKXARC, and PKUNPAK will extract up to level 9; PAK will  extract 
  356.         up to level 11. Specify the appropriate level for each  extractor 
  357.         you  will  be  using.  Note that you  need  not  supply  all  the 
  358.         extractors you have available; for example, PAK will extract  all 
  359.         your  version 5 .ARC files. However, due to speed or  memory  you 
  360.         may  want  to specify several archivers so that the  smallest  or 
  361.         fastest may be used whenever possible.
  362.  
  363.  
  364.  
  365.  
  366.  
  367.            PolyXarc 2.1a: multiple-format archive extractor executive
  368.                                                                 page 7
  369.  
  370.  
  371.         ARC  version  6  is a special case. SEA  introduced  an  extended 
  372.         header  format  that  allows non-file information  to  be  added. 
  373.         Version  5 programs such as PKPAK and PAK cannot deal with  these 
  374.         formats  and  will exit with an error if you try to use  them  on 
  375.         version  6 files. Version 2.0 of Polyxarc also does not know  how 
  376.         to deal with these files. However, even version 6 ARC files  have 
  377.         different  levels, and PAK, a strictly version 5  archiver,  uses 
  378.         compression  levels  that  are incompatible with  ARC  version  6 
  379.         ARC+PLUS.  So  if PolyXarc 2.1 detects version 6  information  in 
  380.         an .ARC file, it will look for an archiver with an ARC6 keyword.
  381.  
  382.         ARC version 6 programs can extract version 5 files. Unfortunatly, 
  383.         PAK level 10 is incompatible with ARC+PLUS level 10. So  PolyXarc 
  384.         tries to use version 5 archivers for version 5 files if they  are 
  385.         specified.  If  no version 5 archiver in your  config  file  will 
  386.         extract  the version 5 archive, PolyXarc will attempt to apply  a 
  387.         version  6  archiver to the file. Note that PolyXarc  will  never 
  388.         attempt  to  use  a version 5 archiver to  extract  a  version  6 
  389.         archive.
  390.  
  391.         Please  note that unlike PolyXarc version 2.0,  PolyXarc  version 
  392.         2.1  does not need the .ARC format signature lines listed in  any 
  393.         particular  order.  Version  2.1  now  automatically  sorts   the 
  394.         signatures  once it reads them in. All you have to do is get  the 
  395.         levels and versions right.
  396.  
  397.         If  this is confusing to you, imagine how difficult it is  trying 
  398.         to  describe it! But if you use the commands in  the  distributed 
  399.         POLYXARC.CFG   file  you  should  be  ok.  You  may   also   read 
  400.         POLYXPLN.DOC for some more detailed explanations.
  401.  
  402.         An  example  of mixed ARC lines (remember, ARC and ARC5  are  the 
  403.         same):
  404.  
  405.            ARC5       8    /r ""  arce %3 %4 %2
  406.            ARC       11   /WA ""  pak /e %2 %3 %4
  407.            ARC6      10    /o ""  xarc %2 %3 %4
  408.  
  409.         Ok,  back  to  the syntax descriptions. A reminder  of  what  the 
  410.         signature lines look like:
  411.  
  412.           ARC level overwrite extract command_template
  413.           ARC5 level overwrite extract command_template
  414.           ARC6 level overwrite extract command_template
  415.  
  416.         Overwrite is the parameter this particular archive program  needs 
  417.         in   order  to  automatically  overwrite  existing  files   while 
  418.         extracting. The overwrite parameter must be 5 characters or less.
  419.  
  420.         Extract is the parameter this particular archive program needs in 
  421.         order to extract files. This is only used for programs which  use 
  422.         different  commmands for 'extract' and 'extract  overwrite'.  The 
  423.         extract parameter must be 5 characters or less.
  424.  
  425.  
  426.  
  427.  
  428.            PolyXarc 2.1a: multiple-format archive extractor executive
  429.                                                                 page 8
  430.  
  431.  
  432.         In  most cases you will not need the extract parameter.  However, 
  433.         there  must  be something defined for each field, whether  it  is 
  434.         used or not. In my distributed configuration file I simply put in 
  435.         an empty string ("") as a place holder.
  436.  
  437.         The command template defines the command line (including the name 
  438.         of  the arc file) used to invoke the necessary de-archiver.  
  439.  
  440.         Here are some examples from the distributed configuration file:
  441.  
  442.            ARC        8    /r  ""  arce %3 %4 %2
  443.            ARC        9    /r  ""  pkunpak %2 %3 %4
  444.            ARC6      10    /o  ""  xarc %2 %3 %4
  445.            ARC       11   /WA /WO  pak /e %1%2 %3 %4
  446.  
  447.         Here is the PAK command line that PolyXarc might generate,  first 
  448.         with overwrite enabled, then without:
  449.  
  450.           pak /e /WA 0000FFFB.MO2 
  451.           pak /e /WO 0000FFFB.MO2 
  452.  
  453.         Here is the PKUNPAK command line in the same order:
  454.  
  455.           pkunpak /r 0000FFFB.MO2
  456.           pkunpak  0000FFFB.MO2
  457.  
  458.         General syntax for the SIGNATURE keyword:
  459.  
  460.           SIGNATURE type offset signature overwrite extract template
  461.  
  462.         This command allows PolyXarc to automatically recognize different 
  463.         compressor   archive  formats  without  being  locked  into   any 
  464.         particular format or set of formats. Note that you should not try 
  465.         to  define  a  SIGNATURE  for .ARC  format  files,  as  they  are 
  466.         recognized  internally. The different signatures will  be  looked 
  467.         for in order of definition, with .ARC files coming last. 
  468.  
  469.         Offset is the offset into the file of the signature. If offset is 
  470.         preceeded  by a '-' (minus sign), PolyXarc will  count  backwards 
  471.         from the end of the file. 
  472.  
  473.         Signature  is the text of the signature. The signature  parameter 
  474.         must be 5 characters or less.
  475.  
  476.         Overwrite is the parameter this particular archive program  needs 
  477.         in   order  to  automatically  overwrite  existing  files   while 
  478.         extracting. The overwrite parameter must be 5 characters or less.
  479.  
  480.         Extract is the parameter this particular archive program needs in 
  481.         order to extract files. This is only used for programs which  use 
  482.         different  commmands for 'extract' and 'extract  overwrite'.  The 
  483.         extract parameter must be 5 characters or less.
  484.  
  485.  
  486.  
  487.  
  488.  
  489.            PolyXarc 2.1a: multiple-format archive extractor executive
  490.                                                                 page 9
  491.  
  492.  
  493.         In  most cases you will not need the extract parameter.  However, 
  494.         there  must  be something defined for each field, whether  it  is 
  495.         used or not. In my distributed configuration file I simply put in 
  496.         an empty string ("") as a place holder.
  497.  
  498.         The command template defines the command line (including the name 
  499.         of the arc file) used to invoke the necessary de-archiver.
  500.  
  501.         Here are some examples from the distributed configuration file:
  502.  
  503.            SIGNATURE  -3   DWC      w   ""    dwc e%2 %3 %4
  504.            SIGNATURE   2  -lh     /mc   ""    lharc e %2 %3 %4
  505.            SIGNATURE   0   ZOO      O   ""    zoo x%2 %3 %4
  506.            SIGNATURE   0   PK      -o   ""    pkunzip %2 %3 %4
  507.            SIGNATURE   0   PK     /WA  /WO    pak /e /z %1%2 %3 %4
  508.            SIGNATURE   0 <60EA>    -y   ""    arj e %2 %3 %4
  509.  
  510.         An expanded Zoo command line would look like this, first without, 
  511.         then with overwrite:
  512.  
  513.           zoo x 0000FFFB.MO2 
  514.           zoo xO 0000FFFB.MO2 
  515.  
  516.         The NOSORT keyword syntax is:
  517.  
  518.           NOSORT
  519.  
  520.         If specified, NOSORT causes PolyXarc not to attempt to sort  .ARC 
  521.         format  files.  (Notice that PolyXarc will not  attempt  to  sort 
  522.         version  6  archive files in any case. That is because  only  one 
  523.         obsolete  version  5 program, PKARC/PKPAK,  sorts  alphabetically 
  524.         when  adding to an archive, and because some extended  version  6 
  525.         headers are position dependent.) This is almost identical to  the 
  526.         -N switch on the command line. If neither is specified,  PolyXarc 
  527.         will  attempt to sort the files in .ARC format archives  by  date 
  528.         and  time in order to keep mail packets in  chronological  order. 
  529.         This is in case the sender used PKPAK or PKARC to pack his  mail; 
  530.         they  will  sort the files in the archive  alphabetically,  which 
  531.         occasionally causes messages to get out of order. Note that while 
  532.         the  -F  switch will override the -N switch, the  NOSORT  keyword 
  533.         overrides the -F switch, causing PolyXarc never to sort.
  534.  
  535.         PolyXarc  allows some special character sequences in  the  config 
  536.         file.  The  two  main  sequences are:  quoted  strings,  and  hex 
  537.         numbers.  These are a lot easier to use than to explain,  but  if 
  538.         you  want  to skip ahead there is a summary at the  end  of  this 
  539.         explanation.
  540.  
  541.         Normally  PolyXarc  just treats a character as a  character.  For 
  542.         example, this line:
  543.  
  544.            SIGNATURE   0   PK     /WA  /WO    pak /e /z %1%2 %3 %4
  545.  
  546.         is interpreted exactly as you would think. One or more spaces  or 
  547.         tabs  separate each parameter on the line. Since the template  is 
  548.  
  549.  
  550.            PolyXarc 2.1a: multiple-format archive extractor executive
  551.                                                                 page 10
  552.  
  553.  
  554.         the  last parameter on the line, we always know where it  starts, 
  555.         and  everything  after that is part of the template,  so  we  can 
  556.         imbed spaces into the template with impunity. However, there  are 
  557.         times  when you may need to imbed spaces into a  parameter  other 
  558.         than the template. In that case you must enclose the parameter in 
  559.         quotes. For example, if you had a signature with a space: 
  560.  
  561.            NEW 1 
  562.  
  563.         You  would  have  to put quotes around it  in  the  config  file, 
  564.         something like this:
  565.  
  566.            SIGNATURE   0   "NEW 1"  -o  -e  NEW %1%2 %3 %4
  567.  
  568.         This  also  allows you to include an empty string in  the  config 
  569.         file. For example:
  570.  
  571.            SIGNATURE   0   PK      -o   ""    pkunzip %2 %3 %4
  572.  
  573.         Notice  that  instead of an extraction parameter, there  are  two 
  574.         double-quotes.  PolyXarc  sees  the quotes and  knows  there's  a 
  575.         parameter there, but since there's nothing between them, PolyXarc 
  576.         will store an empty string. That way if you accidentally  include 
  577.         that parameter in the template, nothing will happen; and even  if 
  578.         you don't, the parameter will not take up any room in memory.
  579.  
  580.         Note  that you don't have to put the whole string in quotes.  For 
  581.         example,  you can put "NEW 1" as NEW" 1"; once PolyXarc sees  the 
  582.         first  quote, it will continue ignoring spaces until it sees  the 
  583.         second  quote. Also note that you MUST have a closing  quote,  or 
  584.         PolyXarc will keep going until the end of the line, and the  rest 
  585.         of the parameters on that line will be lost.
  586.  
  587.         Besides  using  quotes,  you  can also imbed  hex  numbers  in  a 
  588.         parameter  instead  of  just  using  printable  characters.   For 
  589.         example:
  590.  
  591.            SIGNATURE   0 <60EA>    -y   ""    arj e %2 %3 %4
  592.  
  593.         This program's signature consists of two characters, one of  them 
  594.         unprintable, at the beginning of the file. Instead of making  you 
  595.         try  to imbed the second character directly into the config  file 
  596.         with  a fancy editor, I've allowed you to describe the  character 
  597.         by  giving its ASCII value in hexadecimal. When PolyXarc  sees  a 
  598.         less-than  character  (<),  it  goes into  Hex  mode  and  starts 
  599.         interpreting  the following characters as hex numbers,  until  it 
  600.         sees a greater-than character (>) or reaches the end of the line. 
  601.         Notice  that  this is like the quote feature, in that  you  don't 
  602.         have to make the entire parameter hex if you have some  printable 
  603.         characters. In the example above, the first character is actually 
  604.         printable; you could define it like this instead:
  605.  
  606.            SIGNATURE   0  `<EA>    -y   ""    arj e %2 %3 %4
  607.  
  608.  
  609.  
  610.  
  611.            PolyXarc 2.1a: multiple-format archive extractor executive
  612.                                                                 page 11
  613.  
  614.  
  615.         Now  there  are a few more rules for hex digits.  First  of  all, 
  616.         PolyXarc  expects that the hex digits will be in pairs. One  pair 
  617.         of digits describes a character. You can define an odd number  of 
  618.         digits, but you may not get the results you expect. For  example, 
  619.         <615>  is  not the same as <0615> or <6150>; it is  the  same  as 
  620.         <6105>. Your best bet is to use character pairs, or see the  next 
  621.         rule. 
  622.  
  623.         Another  rule  is that anything that isn't a (>) or a  hex  digit 
  624.         will  break a character description, assume that  it's  finished, 
  625.         and start on the next character. For example, <6 15> is the  same 
  626.         as  <0615>  is the same as <06 15> is the same as  <  6,15>.  The 
  627.         spaces and commas act as separators. This provides a handy visual 
  628.         breakup.
  629.  
  630.         Now,  it is possible that you will want to have the characters  " 
  631.         or  < in one of your signatures. To accomodate that I  added  the 
  632.         "literal"  character, which is a backslash (\). When  encountered 
  633.         in normal mode or inside a quote, the backslash tells PolyXarc to 
  634.         take  the  next character literally. This way you can  imbed  the 
  635.         quote or less-than characters without having to go into hex  mode 
  636.         and  describe  them  in hex. If you want to  imbed  a  backslash, 
  637.         simply  include two backslashes: \\. PolyXarc will see the  first 
  638.         one as a directive ("take the next character literally") and then 
  639.         take the second one as a character.
  640.  
  641.         Limitations:  You cannot change modes between hex and quoting  in 
  642.         the  middle  of  a quote or hex sequence. If you  are  in  a  hex 
  643.         sequence  and  want to start a quote you must first end  the  hex 
  644.         sequence.  If  you are in a quote string you cannot imbed  a  hex 
  645.         sequence; you must end the quote. A '<' in the middle of a  quote 
  646.         is treated as a normal character. For example:
  647.  
  648.           <4142>  converts to "AB"
  649.           <41>B   converts to "AB"
  650.           A<42>   converts to "AB"
  651.           "A"<42> converts to "AB"
  652.           <41>"B" converts to "AB"
  653.           "A<41>" converts to "A<41>"
  654.           <41"B"> converts to "A." (where . is actually an unprintable
  655.                                     character with a numeric value of 0B)
  656.  
  657.         Here is a summary of the rules:
  658.  
  659.          - A whitespace character is a space or tab.
  660.          - Normally, each non-whitespace character is simply treated as a 
  661.            character.
  662.          - If  you place double-quotes (") around a string or part  of  a 
  663.            string,  that  string  will  be  accepted  intact,   including 
  664.            whitespace.
  665.  
  666.  
  667.  
  668.  
  669.  
  670.  
  671.  
  672.            PolyXarc 2.1a: multiple-format archive extractor executive
  673.                                                                 page 12
  674.  
  675.  
  676.          - If  you imbed a backslash ('\'), the backslash will be  thrown 
  677.            away  and the next character will be accepted as a  character. 
  678.            This  allows you to imbed the double-quote (")  and  less-than 
  679.            (<)  characters as regular characters. To use a  backslash  as 
  680.            part  of a string you must imbed two backslashes ('\\');  this 
  681.            will translate to a single backslash.
  682.          - If  you place a less-than sign (<) in a string, the  following 
  683.            characters will be considered to be 2-digit hex numbers  until 
  684.            a greater-than sign (>) is reached. A hex digit is any numeric 
  685.            digit  (0-9) or any letter from A to F (a-f or A-F).  Normally 
  686.            the  hex  digits  will be taken in pairs,  but  if  any  other 
  687.            character  is imbedded, it will be considered to be  a  number 
  688.            break and the next digit will start the next number.
  689.  
  690.         TECHNICAL SECTION
  691.         =================
  692.         PolyXarc  figures  out what format is being used by  looking  for 
  693.         certain  characteristics  in the file. For  example,  each  PKZIP 
  694.         format file has "PK" as the first two bytes in the file. All .ARC 
  695.         format files have a hex 1A value as the first byte. The SIGNATURE 
  696.         lines in the configuration file describe what to look for,  where 
  697.         to look for it, and what command syntax to use if PolyXarc  finds 
  698.         it.
  699.  
  700.          ...except for .ARC files. Over the years .ARC files have added a 
  701.         number  of  different formats. Each time one is  added,  it  gets 
  702.         assigned  a  level. The standard programs (ARC, ARCA,  and  ARCE) 
  703.         support up to level 8. PKPAK added level 9, and PAK added  levels 
  704.         10  and 11. Due to program size and other considerations,  people 
  705.         often  prefer  to use the minimum program required for  the  job. 
  706.         Also, some archive extractors are faster than others. Either way, 
  707.         the  ARC  lines in the configuration file describe what  to  look 
  708.         for,  and what command syntax to use if PolyXarc finds  it.  Each 
  709.         ARC  line  has a level number. That number is the  highest  level 
  710.         that  program  will support, not just the only  number.  PolyXarc 
  711.         always  uses the minimum specified program for the highest  level 
  712.         found in the archive.
  713.  
  714.         The  exceptions, as explained before, are ARC6 programs.  Because 
  715.         they  support an extended set of ARC formats, their archives  are 
  716.         readily   identifiable  and  are  incompatible  with  version   5 
  717.         archives. If you have both an ARC5 and an ARC6 program supporting 
  718.         a compression level, the ARC5 program will always be used for  an 
  719.         ARC5  file using that level. An ARC6 program will always be  used 
  720.         to extract an ARC6 file.
  721.  
  722.         EXAMPLES
  723.         ========
  724.         I have my incoming and outgoing mail on two different drives.  To 
  725.         optimize  space  usage  on my outgoing  drive,  I  have  PolyXarc 
  726.         extract  the  archives into the incoming directory before  I  let 
  727.         QMail loose on them. Therefore my batch file looks something like 
  728.         this:
  729.  
  730.  
  731.  
  732.  
  733.            PolyXarc 2.1a: multiple-format archive extractor executive
  734.                                                                 page 13
  735.  
  736.  
  737.            C:
  738.            CD \NET\FILE
  739.            PolyXarc -F -M273/715
  740.            E:
  741.            QM TOSS etc.
  742.  
  743.         If you want to run PolyXarc directly from Opus 1.0 on a  barefoot 
  744.         Opus  system,  simply  rename POLYXARC.EXE to  ARCE.EXE.  If  you 
  745.         already  have the real ARCE someplace on your system,  make  sure 
  746.         that  the  renamed  PolyXarc is either earlier in  the  path,  or 
  747.         replaces  ARCE, or is in the directory you are running  it  from. 
  748.         Otherwise,  it  will quite likely find the original  ARCE  first. 
  749.         Remember  also,  if you have ARCE.COM and ARCE.EXE  in  the  same 
  750.         directory, DOS will always run ARCE.COM. Also remember to  either 
  751.         remove the ARCE control line from PolyXarc's configuration  file, 
  752.         or  else  specify  ARCE's path in  the  control  line;  otherwise 
  753.         PolyXarc will end up trying to execute itself and you will end up 
  754.         with what is known in the business as 'a mess'.
  755.  
  756.         To use PolyXarc from Confmail, add the -A parameter to the end of 
  757.         Confmail's command line:
  758.  
  759.            Confmail import blah blah blah -A PolyXarc -o -m273/715
  760.  
  761.         RETURN CODES &c.
  762.         ================
  763.            0 = No error.
  764.            1 = Can't open/read source (missing or invalid file).
  765.            2 = Can't create/write dest (maybe disk or directory full).
  766.            3 = Can't delete old source file (read-only).
  767.            4 = Can't rename temp file to source name.
  768.            5 = Out of memory.
  769.            6 = Cannot determine archive type.
  770.            7 = Configuration file syntax error.
  771.            8 = Error was returned from the archive extractor.
  772.            9 = File was zero-length.
  773.           10 = DOS error while trying to execute the extractor.
  774.  
  775.         Note that if you use the -f switch, not all of these errors  will 
  776.         be returned. In the case of a zero-length file, PolyXarc -f  will 
  777.         simply give a warning message, delete the file, and go on. In the 
  778.         cases  of  errors 3, 6 and 8, PolyXarc will rename  the  file  to 
  779.         BAD_ARC.???  (where ??? is an ascending decimal  number  starting 
  780.         from 000) and go on.
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.  
  790.  
  791.  
  792.  
  793.  
  794.            PolyXarc 2.1a: multiple-format archive extractor executive
  795.                                                                 page 14
  796.  
  797.  
  798.         CAVEATS
  799.         =======
  800.         If  a  file has been transferred via XMODEM, the last  record  of 
  801.         that  file  will  be  padded with nulls.  In  the  case  of  DWC-
  802.         compressed files, this can be a problem. Since PolyXarc looks for 
  803.         "DWC"  at  the  end  of the file, the  null  padding  will  cause 
  804.         PolyXarc  not to recognize a DWC file. I could add enough  smarts 
  805.         into  PolyXarc  to have it search backwards  through  the  nulls. 
  806.         However,  DWC  is not used by many people, and  there  are  other 
  807.         archivers that work just as well, so it doesn't seem  worthwhile. 
  808.         This  is a potential problem for any archiver whose signature  is 
  809.         at the end of the file, though at the moment I don't know of  any 
  810.         besides DWC.
  811.  
  812.         ACKNOWLEDGEMENTS
  813.         ================
  814.         Thanks to Mike Housky for the entire .ARC format  search-and-sort 
  815.         section.  I  shamelessly  stole it straight out  of  his  PAKSORT 
  816.         program.  Thanks  also  to Dan Thomson for  coming  up  with  the 
  817.         original  program,  SPAZ,  and saving me a lot  of  research  and 
  818.         planning. (There is probably no easier program to design than one 
  819.         for which you have a working model!)
  820.  
  821.         Many  thanks  to John Lull and Clay Tinsley, two of  my  original 
  822.         beta  testers. They faithfully ran every revision I put  out  and 
  823.         let  me  know whenever something went wrong. (Which  was  often.) 
  824.         Clay  was also responsible for convincing me to  write  PolyXarc. 
  825.         David   Page,  another  beta  tester,  also  gave  some   helpful 
  826.         criticism.
  827.  
  828.         Thanks  to  Steve Palm, who ported PolyXarc over to  use  on  his 
  829.         Amiga, and Bill Andrus, who ported PolyXarc over to OS/2. Between 
  830.         us  we  came up with a set of source files and  definitions  that 
  831.         allow  us  to  compile  the  same  source  under  our  respective 
  832.         operating systems.
  833.  
  834.         Thanks to Peter Stern for helping track down some subtle bugs  in 
  835.         version  2.0.
  836.  
  837.         Thanks in no particular order to Thom Henderson, Phil Katz, Rahul 
  838.         Dhesi,  David W. Cooper, Nogate Consulting,  Haruyasu  Yoshizaki, 
  839.         Vernon  Buerg, Wayne Chin, Robert K. Jung, Klaus  Peter  Nischke, 
  840.         Peter Sawatzki, and all the other archive program authors for all 
  841.         their hard work. Keep it up, guys!
  842.  
  843.         And as always, thanks to Ward Christensen for everything. 
  844.  
  845.                         Jeffrey J. Nonken
  846.                         1706 Cherrie Circle
  847.                         Blue Bell, Pa.   19422-3412
  848.                         BBS: (215)279-9799 HST/v.32
  849.                         Fidonet: 1:273/715
  850.                         Internet: Jeffrey.Nonken@f715.n273.z1.fidonet.org
  851.  
  852.  
  853.  
  854.  
  855.            PolyXarc 2.1a: multiple-format archive extractor executive
  856.                                                                 page 15
  857.  
  858.  
  859.         Note: the above Snailmail address and phone number may change  in 
  860.         the  next few months. Please use my Fidonet or Internet  address, 
  861.         or check the latest Nodelist for the current information.
  862.  
  863.         As I write this I expect to be at 1145 Pleasant Avenue, Wyndmoor, 
  864.         Pa. 19118 by the end of July. Of course, things are never as easy 
  865.         as  they  seem, so it's best to check before  you  send  anything 
  866.         there.  If  you aren't sure where to send Snailmail to,  you  can 
  867.         always use this address:
  868.  
  869.                         Jeffrey J. Nonken
  870.                         507 Ave. Presidio
  871.                         San Clemente, Ca. 92672
  872.  
  873.  
  874.  
  875.  
  876.  
  877.  
  878.  
  879.  
  880.  
  881.  
  882.  
  883.  
  884.  
  885.  
  886.  
  887.  
  888.  
  889.  
  890.  
  891.  
  892.  
  893.  
  894.  
  895.  
  896.  
  897.  
  898.  
  899.  
  900.  
  901.  
  902.  
  903.  
  904.  
  905.  
  906.  
  907.  
  908.  
  909.  
  910.  
  911.  
  912.  
  913.  
  914.  
  915.  
  916.            PolyXarc 2.1a: multiple-format archive extractor executive
  917.